package com.css.dzj.dzjdzqs.modules.jhscheduler;

import com.css.dzj.dzjdzqs.modules.apaction.apcheck.service.ApCheckService;
import com.css.dzj.dzjdzqs.modules.apaction.apforce.service.ApForceService;
import com.css.dzj.dzjdzqs.modules.apaction.apother.service.ApOtherService;
import com.css.dzj.dzjdzqs.modules.apaction.appunish.service.ApPunishService;
import com.css.dzj.dzjdzqs.modules.apaction.aprandomplan.service.JgZtkJgxnSsjygkNdjhsjService;
import com.css.dzj.dzjdzqs.modules.apaction.aprandomplan.service.JgZtkJgxnSsjygkSpotCheckService;
import com.css.dzj.dzjdzqs.modules.apaction.aprecordandgain.service.JgJgdxCdcsPlaceService;
import com.css.dzj.dzjdzqs.modules.apinfo.service.ApInfoService;
import com.css.dzj.dzjdzqs.modules.aplaw.service.ApLawService;
import com.css.dzj.dzjdzqs.modules.apunitmessage.service.JgJgdxQyjbxxService;
import com.css.dzj.dzjdzqs.modules.datafromzfjg.service.JgLhjgJcdxService;
import com.css.dzj.dzjdzqs.modules.datafromzfjg.service.JgLhjgRwsFkglSercice;
import com.css.dzj.dzjdzqs.modules.datafromzfjg.service.JgLhjgRwsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * 定时任务
 * @Author WT
 * @Date 2020/7/2
 */
@Component
public class Scheduler {

    @Autowired
    private ApCheckService apCheckService;//行政检查行为
    @Autowired
    private ApForceService apForceService;//行政强制行为
    @Autowired
    private ApOtherService apOtherService;//行为信息其他行为
    @Autowired
    private ApPunishService apPunishService;//行政处罚行为
    @Autowired
    private ApInfoService apInfoService;//执法监管人员信息
    @Autowired
    private ApLawService apLawService;//法律法规库
    @Autowired
    private JgZtkJgxnSsjygkNdjhsjService jgZtkJgxnSsjygkNdjhsjService;//双随机一公开数据的年度计划数据
    @Autowired
    private JgZtkJgxnSsjygkSpotCheckService jgZtkJgxnSsjygkSpotCheckService;//双随机一公开数据的年度计划抽查的监管对象信息
    @Autowired
    private JgJgdxCdcsPlaceService jgJgdxCdcsPlaceService;//场地场所（如建筑工地、水库）信息
    @Autowired
    private JgJgdxQyjbxxService jgJgdxQyjbxxService;//行政相对人-企业法人基本信息
    @Autowired
    private JgLhjgJcdxService jgLhjgJcdxService;//联合监管检查对象表
    @Autowired
    private JgLhjgRwsFkglSercice jgLhjgRwsFkglSercice;//联合监管任务反馈关联表
    @Autowired
    private JgLhjgRwsService jgLhjgRwsService;//联合监管任务书表

    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");

    // 每天下午16:00执行
    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks1(){
        apCheckService.pushtCheck();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks2(){
        apForceService.pushtForce();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks3(){
        apOtherService.pushtOther();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks4(){
        apPunishService.pushtPunish();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks5(){
        apInfoService.pushtInfo();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks6(){
        apLawService.pushtLaw();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks7(){
        jgZtkJgxnSsjygkNdjhsjService.addSsjygk();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks8(){
        jgZtkJgxnSsjygkSpotCheckService.addSsjygkSpotCheck();
    }

    @Async
    @Scheduled(cron = "0 0 16 ? * *")
    public void testTasks9(){
        jgJgdxQyjbxxService.addApUnitMsg();
    }

}
